#include "dialog.h"
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>

DiaLog::DiaLog(QWidget *widget) : QDialog(widget)
{
    QVBoxLayout *layout = new QVBoxLayout(this);
    QLabel *label = new QLabel("这是一个对话框", this);
    QPushButton *push = new QPushButton("按钮", this);

    layout->addWidget(label);
    layout->addWidget(push);

    connect(push, &QPushButton::clicked, this, &DiaLog::Hanlder);
}

void DiaLog::Hanlder()
{
    this->close();
}


